﻿// Models/Option.cs
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WebApplication1.Models
{
    /// <summary>
    /// 选项实体类
    /// </summary>
    [Table("Options")]
    public class Option
    {
        /// <summary>
        /// 选项ID
        /// </summary>
        [Key]
        public int OptionId { get; set; }

        /// <summary>
        /// 所属试题ID
        /// </summary>
        [Required]
        public int QuestionId { get; set; }

        /// <summary>
        /// 选项内容
        /// </summary>
        [Required(ErrorMessage = "选项内容不能为空")]
        [Display(Name = "选项内容")]
        public string OptionText { get; set; }

        /// <summary>
        /// 选项标识 (A, B, C, D...)
        /// </summary>
        [Required]
        [Display(Name = "选项标识")]
        public string OptionLabel { get; set; }

        /// <summary>
        /// 所属试题
        /// </summary>
        public virtual Question Question { get; set; }
    }
}